# encoding=utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os
from GeneralFunction.ExtendForPhotoCheck import Appium_Extend
from Configure import Attribute
from GeneralService import Login
from GeneralFunction.UnitFunction import getScreenShot

class logincase(Login.BaseLogin):
    def test_loginsuccess(self):
        self.login()
        self.extend = Appium_Extend(self.driver)
        loginImagePath1=getScreenShot(self.driver,"login")
        self.driver.find_element_by_id(Attribute.bottom_mine_id).click()
        loginImagePath2 = getScreenShot(self.driver,"mine")
        result = self.extend.get_screenshot_by_All().same_as_check_image(loginImagePath1,loginImagePath2, 5)
        #self.assertTrue(result)
        self.driver.find_element_by_id(Attribute.bottom_classQuan_id).click()
        loginImagePath3 = getScreenShot(self.driver, "login")
        result = self.extend.get_screenshot_by_All().same_as_check_image(loginImagePath1, loginImagePath3, 5)
        self.assertTrue(result)